{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:35:44.711951Z",
     "start_time": "2019-04-10T12:35:36.729255Z"
    }
   },
   "outputs": [],
   "source": [
    "#先引入后面可能用到的包（package）\n",
    "import pandas as pd  \n",
    "import numpy as np\n",
    "from scipy import stats\n",
    "import tushare as ts \n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline   \n",
    "import xlrd\n",
    "\n",
    "\n",
    "#正常显示画图时出现的中文和负号\n",
    "from pylab import mpl\n",
    "mpl.rcParams['font.sans-serif']=['SimHei']\n",
    "mpl.rcParams['axes.unicode_minus']=False"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 金融增加值/GDP\n",
    "金融业增加值主要指银行、证券、保险产生的增加值。在金融去杠杆，同业、理财、非标强监管下，相关业务增速放缓，对金融业增加值增速带来影响。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:35:47.697349Z",
     "start_time": "2019-04-10T12:35:47.592629Z"
    }
   },
   "outputs": [],
   "source": [
    "df=pd.read_excel('金融增加值gdp.xls')[1:67]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:35:48.749338Z",
     "start_time": "2019-04-10T12:35:48.680521Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>金融业增加值</th>\n",
       "      <th>GDP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1952-12-31</th>\n",
       "      <td>11.7</td>\n",
       "      <td>679.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1953-12-31</th>\n",
       "      <td>11.9</td>\n",
       "      <td>824.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1954-12-31</th>\n",
       "      <td>11.8</td>\n",
       "      <td>859.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1955-12-31</th>\n",
       "      <td>13.8</td>\n",
       "      <td>911.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1956-12-31</th>\n",
       "      <td>14.1</td>\n",
       "      <td>1030.7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           金融业增加值     GDP\n",
       "date                     \n",
       "1952-12-31   11.7   679.1\n",
       "1953-12-31   11.9   824.4\n",
       "1954-12-31   11.8   859.8\n",
       "1955-12-31   13.8   911.6\n",
       "1956-12-31   14.1  1030.7"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.rename(columns={'指标名称':'date','第三产业增加值:金融业':'金融业增加值','GDP:现价':'GDP'},inplace=True)\n",
    "df.index=pd.to_datetime(df.date)\n",
    "df=df.iloc[:,1:]\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:35:49.522945Z",
     "start_time": "2019-04-10T12:35:49.517957Z"
    }
   },
   "outputs": [],
   "source": [
    "df1=pd.DataFrame(df,dtype=np.float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:35:50.594345Z",
     "start_time": "2019-04-10T12:35:50.478653Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>金融业增加值</th>\n",
       "      <th>GDP</th>\n",
       "      <th>金融业增加值/GDP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1952-12-31</th>\n",
       "      <td>11.7</td>\n",
       "      <td>679.1</td>\n",
       "      <td>1.72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1953-12-31</th>\n",
       "      <td>11.9</td>\n",
       "      <td>824.4</td>\n",
       "      <td>1.44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1954-12-31</th>\n",
       "      <td>11.8</td>\n",
       "      <td>859.8</td>\n",
       "      <td>1.37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1955-12-31</th>\n",
       "      <td>13.8</td>\n",
       "      <td>911.6</td>\n",
       "      <td>1.51</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1956-12-31</th>\n",
       "      <td>14.1</td>\n",
       "      <td>1030.7</td>\n",
       "      <td>1.37</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            金融业增加值     GDP  金融业增加值/GDP\n",
       "date                                  \n",
       "1952-12-31    11.7   679.1        1.72\n",
       "1953-12-31    11.9   824.4        1.44\n",
       "1954-12-31    11.8   859.8        1.37\n",
       "1955-12-31    13.8   911.6        1.51\n",
       "1956-12-31    14.1  1030.7        1.37"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1['金融业增加值/GDP']=((df1['金融业增加值']/df1['GDP'])*100).round(2)\n",
    "df1.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:35:51.228647Z",
     "start_time": "2019-04-10T12:35:51.222665Z"
    }
   },
   "outputs": [],
   "source": [
    "#提取时间函数\n",
    "def date_trans(date):\n",
    "    year=[]\n",
    "    for i in range(0,len(date)):\n",
    "        year.append(date[i].strftime(\"%Y\"))\n",
    "    return year"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:35:52.514822Z",
     "start_time": "2019-04-10T12:35:52.502853Z"
    }
   },
   "outputs": [],
   "source": [
    "date=df1.loc['1977-12-31':].index\n",
    "year=date_trans(date)\n",
    "v1=list(df1.loc['1977-12-31':,'金融业增加值/GDP'])\n",
    "#v2=list(df1.loc['1977-12-31':,'GDP增长率'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:35:55.413524Z",
     "start_time": "2019-04-10T12:35:53.790863Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"a8f6027688124c1693b32671879c47a3\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_a8f6027688124c1693b32671879c47a3 = echarts.init(document.getElementById('a8f6027688124c1693b32671879c47a3'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_a8f6027688124c1693b32671879c47a3 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u91d1\\u878d\\u4e1a\\u589e\\u52a0\\u503c\\u5360GDP\\u6bd4\\u91cd(%)\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 15\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 6470183,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u91d1\\u878d\\u4e1a\\u589e\\u52a0\\u503c/GDP\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"1977\",\n",
       "                    2.12\n",
       "                ],\n",
       "                [\n",
       "                    \"1978\",\n",
       "                    2.08\n",
       "                ],\n",
       "                [\n",
       "                    \"1979\",\n",
       "                    1.85\n",
       "                ],\n",
       "                [\n",
       "                    \"1980\",\n",
       "                    1.87\n",
       "                ],\n",
       "                [\n",
       "                    \"1981\",\n",
       "                    1.86\n",
       "                ],\n",
       "                [\n",
       "                    \"1982\",\n",
       "                    2.43\n",
       "                ],\n",
       "                [\n",
       "                    \"1983\",\n",
       "                    2.81\n",
       "                ],\n",
       "                [\n",
       "                    \"1984\",\n",
       "                    3.17\n",
       "                ],\n",
       "                [\n",
       "                    \"1985\",\n",
       "                    3.23\n",
       "                ],\n",
       "                [\n",
       "                    \"1986\",\n",
       "                    3.86\n",
       "                ],\n",
       "                [\n",
       "                    \"1987\",\n",
       "                    4.16\n",
       "                ],\n",
       "                [\n",
       "                    \"1988\",\n",
       "                    4.34\n",
       "                ],\n",
       "                [\n",
       "                    \"1989\",\n",
       "                    6.28\n",
       "                ],\n",
       "                [\n",
       "                    \"1990\",\n",
       "                    6.06\n",
       "                ],\n",
       "                [\n",
       "                    \"1991\",\n",
       "                    5.43\n",
       "                ],\n",
       "                [\n",
       "                    \"1992\",\n",
       "                    5.45\n",
       "                ],\n",
       "                [\n",
       "                    \"1993\",\n",
       "                    5.33\n",
       "                ],\n",
       "                [\n",
       "                    \"1994\",\n",
       "                    5.26\n",
       "                ],\n",
       "                [\n",
       "                    \"1995\",\n",
       "                    5.23\n",
       "                ],\n",
       "                [\n",
       "                    \"1996\",\n",
       "                    5.15\n",
       "                ],\n",
       "                [\n",
       "                    \"1997\",\n",
       "                    5.24\n",
       "                ],\n",
       "                [\n",
       "                    \"1998\",\n",
       "                    5.06\n",
       "                ],\n",
       "                [\n",
       "                    \"1999\",\n",
       "                    4.95\n",
       "                ],\n",
       "                [\n",
       "                    \"2000\",\n",
       "                    4.82\n",
       "                ],\n",
       "                [\n",
       "                    \"2001\",\n",
       "                    4.69\n",
       "                ],\n",
       "                [\n",
       "                    \"2002\",\n",
       "                    4.56\n",
       "                ],\n",
       "                [\n",
       "                    \"2003\",\n",
       "                    4.39\n",
       "                ],\n",
       "                [\n",
       "                    \"2004\",\n",
       "                    4.07\n",
       "                ],\n",
       "                [\n",
       "                    \"2005\",\n",
       "                    3.99\n",
       "                ],\n",
       "                [\n",
       "                    \"2006\",\n",
       "                    4.54\n",
       "                ],\n",
       "                [\n",
       "                    \"2007\",\n",
       "                    5.62\n",
       "                ],\n",
       "                [\n",
       "                    \"2008\",\n",
       "                    5.73\n",
       "                ],\n",
       "                [\n",
       "                    \"2009\",\n",
       "                    6.24\n",
       "                ],\n",
       "                [\n",
       "                    \"2010\",\n",
       "                    6.22\n",
       "                ],\n",
       "                [\n",
       "                    \"2011\",\n",
       "                    6.27\n",
       "                ],\n",
       "                [\n",
       "                    \"2012\",\n",
       "                    6.51\n",
       "                ],\n",
       "                [\n",
       "                    \"2013\",\n",
       "                    6.92\n",
       "                ],\n",
       "                [\n",
       "                    \"2014\",\n",
       "                    7.25\n",
       "                ],\n",
       "                [\n",
       "                    \"2015\",\n",
       "                    8.4\n",
       "                ],\n",
       "                [\n",
       "                    \"2016\",\n",
       "                    8.22\n",
       "                ],\n",
       "                [\n",
       "                    \"2017\",\n",
       "                    7.95\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 2,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"type\": \"max\",\n",
       "                        \"name\": \"Maximum\",\n",
       "                        \"symbol\": \"pin\",\n",
       "                        \"symbolSize\": 50,\n",
       "                        \"label\": {\n",
       "                            \"normal\": {\n",
       "                                \"textStyle\": {\n",
       "                                    \"color\": \"#fff\"\n",
       "                                }\n",
       "                            }\n",
       "                        }\n",
       "                    },\n",
       "                    {\n",
       "                        \"type\": \"min\",\n",
       "                        \"name\": \"Minimum\",\n",
       "                        \"symbol\": \"pin\",\n",
       "                        \"symbolSize\": 50,\n",
       "                        \"label\": {\n",
       "                            \"normal\": {\n",
       "                                \"textStyle\": {\n",
       "                                    \"color\": \"#fff\"\n",
       "                                }\n",
       "                            }\n",
       "                        }\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"type\": \"average\",\n",
       "                        \"name\": \"mean-Value\"\n",
       "                    }\n",
       "                ],\n",
       "                \"symbolSize\": 10\n",
       "            },\n",
       "            \"seriesId\": 6470183\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u91d1\\u878d\\u4e1a\\u589e\\u52a0\\u503c/GDP\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"1977\",\n",
       "                \"1978\",\n",
       "                \"1979\",\n",
       "                \"1980\",\n",
       "                \"1981\",\n",
       "                \"1982\",\n",
       "                \"1983\",\n",
       "                \"1984\",\n",
       "                \"1985\",\n",
       "                \"1986\",\n",
       "                \"1987\",\n",
       "                \"1988\",\n",
       "                \"1989\",\n",
       "                \"1990\",\n",
       "                \"1991\",\n",
       "                \"1992\",\n",
       "                \"1993\",\n",
       "                \"1994\",\n",
       "                \"1995\",\n",
       "                \"1996\",\n",
       "                \"1997\",\n",
       "                \"1998\",\n",
       "                \"1999\",\n",
       "                \"2000\",\n",
       "                \"2001\",\n",
       "                \"2002\",\n",
       "                \"2003\",\n",
       "                \"2004\",\n",
       "                \"2005\",\n",
       "                \"2006\",\n",
       "                \"2007\",\n",
       "                \"2008\",\n",
       "                \"2009\",\n",
       "                \"2010\",\n",
       "                \"2011\",\n",
       "                \"2012\",\n",
       "                \"2013\",\n",
       "                \"2014\",\n",
       "                \"2015\",\n",
       "                \"2016\",\n",
       "                \"2017\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_a8f6027688124c1693b32671879c47a3.setOption(option_a8f6027688124c1693b32671879c47a3);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.line.Line at 0x24f4bf261d0>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Line\n",
    "\n",
    "line=Line(\"金融业增加值占GDP比重(%)\",\n",
    "         title_text_size=15)\n",
    "line.add(\"金融业增加值/GDP\",year,v1,is_smooth=True,mark_line=[\"average\"],\n",
    "         mark_point=[\"max\", \"min\"],line_width=2)\n",
    "#line.add(\"GDP增长率\",year,v2,is_smooth=True,mark_line=[\"average\"],\n",
    "#         mark_point=[\"max\", \"min\"],line_width=2)\n",
    "\n",
    "line\n",
    "#line.render(\"金融业增加值GDP.html\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:35:58.628926Z",
     "start_time": "2019-04-10T12:35:58.605989Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"e294edb799ef4457ac1eed593bfa1ed6\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_e294edb799ef4457ac1eed593bfa1ed6 = echarts.init(document.getElementById('e294edb799ef4457ac1eed593bfa1ed6'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_e294edb799ef4457ac1eed593bfa1ed6 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 1940238,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u91d1\\u878d\\u4e1a\\u589e\\u52a0\\u503c/GDP\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"2007\",\n",
       "                    5.62\n",
       "                ],\n",
       "                [\n",
       "                    \"2008\",\n",
       "                    5.73\n",
       "                ],\n",
       "                [\n",
       "                    \"2009\",\n",
       "                    6.24\n",
       "                ],\n",
       "                [\n",
       "                    \"2010\",\n",
       "                    6.22\n",
       "                ],\n",
       "                [\n",
       "                    \"2011\",\n",
       "                    6.27\n",
       "                ],\n",
       "                [\n",
       "                    \"2012\",\n",
       "                    6.51\n",
       "                ],\n",
       "                [\n",
       "                    \"2013\",\n",
       "                    6.92\n",
       "                ],\n",
       "                [\n",
       "                    \"2014\",\n",
       "                    7.25\n",
       "                ],\n",
       "                [\n",
       "                    \"2015\",\n",
       "                    8.4\n",
       "                ],\n",
       "                [\n",
       "                    \"2016\",\n",
       "                    8.22\n",
       "                ],\n",
       "                [\n",
       "                    \"2017\",\n",
       "                    7.95\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 2,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"type\": \"max\",\n",
       "                        \"name\": \"Maximum\",\n",
       "                        \"symbol\": \"pin\",\n",
       "                        \"symbolSize\": 50,\n",
       "                        \"label\": {\n",
       "                            \"normal\": {\n",
       "                                \"textStyle\": {\n",
       "                                    \"color\": \"#fff\"\n",
       "                                }\n",
       "                            }\n",
       "                        }\n",
       "                    },\n",
       "                    {\n",
       "                        \"type\": \"min\",\n",
       "                        \"name\": \"Minimum\",\n",
       "                        \"symbol\": \"pin\",\n",
       "                        \"symbolSize\": 50,\n",
       "                        \"label\": {\n",
       "                            \"normal\": {\n",
       "                                \"textStyle\": {\n",
       "                                    \"color\": \"#fff\"\n",
       "                                }\n",
       "                            }\n",
       "                        }\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"type\": \"average\",\n",
       "                        \"name\": \"mean-Value\"\n",
       "                    }\n",
       "                ],\n",
       "                \"symbolSize\": 10\n",
       "            },\n",
       "            \"seriesId\": 1940238\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u91d1\\u878d\\u4e1a\\u589e\\u52a0\\u503c/GDP\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"2007\",\n",
       "                \"2008\",\n",
       "                \"2009\",\n",
       "                \"2010\",\n",
       "                \"2011\",\n",
       "                \"2012\",\n",
       "                \"2013\",\n",
       "                \"2014\",\n",
       "                \"2015\",\n",
       "                \"2016\",\n",
       "                \"2017\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_e294edb799ef4457ac1eed593bfa1ed6.setOption(option_e294edb799ef4457ac1eed593bfa1ed6);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.line.Line at 0x24f4bf37320>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "start_date='2007-12-31'\n",
    "date=df1.loc[start_date:].index\n",
    "year=date_trans(date)\n",
    "v1=list(df1.loc[start_date:,'金融业增加值/GDP'])\n",
    "#v2=list(df1.loc[start_date:,'GDP增长率'])\n",
    "from pyecharts import Line\n",
    "\n",
    "line=Line(\"\")\n",
    "line.add(\"金融业增加值/GDP\",year,v1,is_smooth=True,mark_line=[\"average\"],\n",
    "mark_point=[\"max\", \"min\"],line_width=2)\n",
    "#line.add(\"GDP增长率\",year,v2,is_smooth=True,mark_line=[\"average\"],\n",
    "#         mark_point=[\"max\", \"min\"],line_width=2)\n",
    "line"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "回顾改革开放四十周年，我国经济发展其实是在曲折中不断前进的。\n",
    "从1978-2018年来看，金融业增加值/GDP经历了两个持续攀升的时期，也是我国金融行业发展最快的两个时期：一是1979-1989年，在这期间，GDP增长率先从1981年5.17%迅速攀升到15.14%（1978年以来历史最高），转而掉头直下，在1989年和1990年经济增速处于历史低位（1978年至今），而金融业增加值/GDP则一路攀升，在1989年达到6.2%；二是2005-2015年，这期间经济增速也经历了先快速上升后急剧下跌的过程，但是金融业增加值/GDP却一直增加，直到2015年达到8.4%，超过美（7.2%）、日（4.4%）、英（7.2%）三国。金融体系在快速发展过程中，容易出现脱实向虚，积聚金融系统性风险，尤其是近十年，金融链条日益复杂，一些所谓“创新”逐渐脱离实体、沦为纯粹的监管套利等。2016年中央经济工作会议提出，要把防控金融风险放到更加重要的位置，下决心处置一批风险点，着力防控资产泡沫，提高和改进监管能力，确保不发生系统性金融风险，开启了本轮金融严监管的大潮。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 1990：The Economist. China's economy has come to a halt.\n",
    "       《经济学人》 中国的经济将陷入停滞。\n",
    "- 1996：The Economist. China's economy will face a hard landing\n",
    "       《经济学人》 中国的经济将面临硬着陆。\n",
    "- 1998：The Economist: China's economy entering a dangerous period of sluggish growth.\n",
    "       《经济学人》 中国的经济正进入滞涨危险期。\n",
    "- 1999：Bank of Canada: Likelihood of a hard landing for the Chinese economy.\n",
    "        加拿大银行：中国经济可能硬着陆。\n",
    "- 2000：Chicago Tribune: China currency move nails hard landing risk coffin.\n",
    "        芝加哥论坛报： 中国货币政策敲响硬着陆丧钟\n",
    "- 2001：Wilbanks Smith & Thomas: A hard landing in China.\n",
    "        WST资产管理公司：中国正在硬着陆\n",
    "- 2002：Westchester University: China Anxiously Seeks a Soft Economic Landing\n",
    "        Westchester大学：中国紧张的寻求经济软着陆\n",
    "- 2003：New York Times: Banking crisis imperils China\n",
    "        纽约时报：银行危机使中国陷入危险\n",
    "- 2004：The Economist: The great fall of China?\n",
    "       《经济学人》：中国陨落？\n",
    "- 2005：Nouriel Roubini: The Risk of a Hard Landing in China\n",
    "        末日博士Nouriel Roubini：中国的硬着陆危险\n",
    "- 2006：International Economy: Can China Achieve a Soft Landing?\n",
    "        国际经济：中国能实现软着陆么？\n",
    "- 2007：TIME: Is China's Economy Overheating? Can China avoid a hard landing?\n",
    "        时代周刊：中国的经济过热了吗？中国可以躲开硬着陆么？\n",
    "- 2008：Forbes: Hard Landing In China?\n",
    "        福布斯：中国硬着陆？\n",
    "- 2009：Fortune: China's hard landing. China must find a way to recover.\n",
    "        财富杂志：中国的硬着陆。中国必须找到恢复的方法。\n",
    "- 2010: Nouriel Roubini: Hard landing coming in China.\n",
    "        末日博士Nouriel Roubini: 硬着陆正在靠近中国\n",
    "- 2011: Business Insider: A Chinese Hard Landing May Be Closer Than You Think\n",
    "        商业内参：中国硬着陆也许比你想象的更近\n",
    "- 2012: American Interest: Dismal Economic News from China: A Hard Landing\n",
    "        美国利益：中国的糟糕经济消息：一次硬着陆\n",
    "- 2013: Zero Hedge: A Hard Landing In China\n",
    "        零对冲： 中国的一次硬着陆\n",
    "- 2014：CNBC: A hard landing in China.\n",
    "        CNBC: 中国的一次硬着陆\n",
    "- 2015：Forbes: Congratulations You Got Yourself A Chinese Hard Landing.\n",
    "        福布斯：恭喜，你给自己碰到了一次中国硬着陆\n",
    "- 2016：The Economist: Hard landing looms for China\n",
    "       《经济学人》: 硬着陆在中国隐现\n",
    "- 2017：National Interest: Is China's Economy Going To Crash?\n",
    "        国家利益：中国的经济会崩溃么？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:36:09.821777Z",
     "start_time": "2019-04-10T12:36:08.294871Z"
    }
   },
   "outputs": [],
   "source": [
    "stock='sh'\n",
    "df = ts.get_k_data(code=stock, start='1990-12-31',end='2017-12-31')  \n",
    "df.index=pd.to_datetime(df['date'])\n",
    "logret=np.log(df.close/df.close.shift(1))[1:]\n",
    "year=[]\n",
    "d0=df.index\n",
    "for i in range(0,np.size(logret)):\n",
    "    year.append(d0[i].strftime(\"%Y\"))\n",
    "y=pd.DataFrame(logret.values,year,columns=['年收益率'])\n",
    "ret_annual=((np.exp(y.groupby(y.index).sum())-1)*100).round(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T12:36:15.269859Z",
     "start_time": "2019-04-10T12:36:12.294783Z"
    }
   },
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'the label [GDP增长率] is not in the [columns]'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "\u001b[1;32mC:\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m_validate_key\u001b[1;34m(self, key, axis)\u001b[0m\n\u001b[0;32m   1789\u001b[0m                 \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0max\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcontains\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1790\u001b[1;33m                     \u001b[0merror\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1791\u001b[0m             \u001b[1;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36merror\u001b[1;34m()\u001b[0m\n\u001b[0;32m   1784\u001b[0m                                .format(key=key,\n\u001b[1;32m-> 1785\u001b[1;33m                                        axis=self.obj._get_axis_name(axis)))\n\u001b[0m\u001b[0;32m   1786\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mKeyError\u001b[0m: 'the label [GDP增长率] is not in the [columns]'",
      "\nDuring handling of the above exception, another exception occurred:\n",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-11-681b0b4bbfe3>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[0mv0\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mlist\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mret_annual\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'年收益率'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      6\u001b[0m \u001b[0mv1\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlist\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdf1\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'1990-12-31'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'金融业增加值/GDP'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 7\u001b[1;33m \u001b[0mv2\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlist\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdf1\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'1990-12-31'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'GDP增长率'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      8\u001b[0m \u001b[1;31m#上证指数年对数收益率(%)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      9\u001b[0m \u001b[0mbar\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mBar\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"上证指数&金融增加值/GDP&GDP增长率对比\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mtitle_text_size\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m15\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtitle_pos\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m\"40%\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m__getitem__\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m   1470\u001b[0m             \u001b[1;32mexcept\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mKeyError\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mIndexError\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1471\u001b[0m                 \u001b[1;32mpass\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1472\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_getitem_tuple\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1473\u001b[0m         \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1474\u001b[0m             \u001b[1;31m# we by definition only have the 0th axis\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m_getitem_tuple\u001b[1;34m(self, tup)\u001b[0m\n\u001b[0;32m    868\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m_getitem_tuple\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtup\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    869\u001b[0m         \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 870\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_getitem_lowerdim\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtup\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    871\u001b[0m         \u001b[1;32mexcept\u001b[0m \u001b[0mIndexingError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    872\u001b[0m             \u001b[1;32mpass\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m_getitem_lowerdim\u001b[1;34m(self, tup)\u001b[0m\n\u001b[0;32m    996\u001b[0m         \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkey\u001b[0m \u001b[1;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtup\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    997\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[0mis_label_like\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mor\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtuple\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 998\u001b[1;33m                 \u001b[0msection\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_getitem_axis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    999\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1000\u001b[0m                 \u001b[1;31m# we have yielded a scalar ?\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m_getitem_axis\u001b[1;34m(self, key, axis)\u001b[0m\n\u001b[0;32m   1909\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1910\u001b[0m         \u001b[1;31m# fall thru to straight lookup\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1911\u001b[1;33m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_validate_key\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1912\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_get_label\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1913\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m_validate_key\u001b[1;34m(self, key, axis)\u001b[0m\n\u001b[0;32m   1796\u001b[0m                 \u001b[1;32mraise\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1797\u001b[0m             \u001b[1;32mexcept\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1798\u001b[1;33m                 \u001b[0merror\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1799\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1800\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m_is_scalar_access\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36merror\u001b[1;34m()\u001b[0m\n\u001b[0;32m   1783\u001b[0m                 raise KeyError(u\"the label [{key}] is not in the [{axis}]\"\n\u001b[0;32m   1784\u001b[0m                                .format(key=key,\n\u001b[1;32m-> 1785\u001b[1;33m                                        axis=self.obj._get_axis_name(axis)))\n\u001b[0m\u001b[0;32m   1786\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1787\u001b[0m             \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mKeyError\u001b[0m: 'the label [GDP增长率] is not in the [columns]'"
     ]
    }
   ],
   "source": [
    "from pyecharts import Overlap, Bar, Line, Grid\n",
    "grid = Grid()\n",
    "\n",
    "attr = list(ret_annual.index)\n",
    "v0 = list(ret_annual['年收益率'])\n",
    "v1=list(df1.loc['1990-12-31':,'金融业增加值/GDP'])\n",
    "v2=list(df1.loc['1990-12-31':,'GDP增长率'])\n",
    "#上证指数年对数收益率(%)\n",
    "bar = Bar(\"上证指数&金融增加值/GDP&GDP增长率对比\",title_text_size=15, title_pos=\"40%\")\n",
    "bar.add(\"上证指数收益率(%)\", attr, v0,\n",
    "#        mark_line=[\"average\"],mark_point=[\"max\", \"min\"],\n",
    "        is_label_show=False, \n",
    "        is_datazoom_show=True,\n",
    "       legend_pos=\"85%\",\n",
    "       legend_orient=\"vertical\",\n",
    "        legend_top=\"15%\",\n",
    "       )\n",
    "\n",
    "line=Line()\n",
    "line.add(\"金融/GDP\",attr,v1,is_smooth=True,mark_line=[\"average\"],\n",
    "         mark_point=[\"max\", \"min\"])\n",
    "line.add(\"GDP增长率\",attr,v2,is_smooth=True,mark_line=[\"average\"],\n",
    "         mark_point=[\"max\", \"min\"])\n",
    "\n",
    "overlap = Overlap(width=1600, height=600)\n",
    "overlap.add(bar)\n",
    "overlap.add(line, is_add_yaxis=True, yaxis_index=1)\n",
    "\n",
    "grid.add(overlap, grid_right=\"20%\")\n",
    "grid.render(\"上证指数_金融增加值GDP_GDP增长率对比.html\")\n",
    "grid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>金融业增加值/GDP</th>\n",
       "      <th>GDP增长率</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>金融业增加值/GDP</th>\n",
       "      <td>1.00000</td>\n",
       "      <td>-0.24583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>GDP增长率</th>\n",
       "      <td>-0.24583</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            金融业增加值/GDP   GDP增长率\n",
       "金融业增加值/GDP     1.00000 -0.24583\n",
       "GDP增长率        -0.24583  1.00000"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2=df1.loc['1977-12-31':,['金融业增加值/GDP','GDP增长率']]\n",
    "df2.corr('spearman')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "[Errno 2] No such file or directory: 'world_leverage_ratio.xlsx'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-14-e2f0181d0636>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mleverage\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread_excel\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'world_leverage_ratio.xlsx'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[0mleverage\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\envs\\Charts\\lib\\site-packages\\pandas\\util\\_decorators.py\u001b[0m in \u001b[0;36mwrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m    176\u001b[0m                 \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    177\u001b[0m                     \u001b[0mkwargs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mnew_arg_name\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnew_arg_value\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 178\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    179\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0mwrapper\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    180\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0m_deprecate_kwarg\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\envs\\Charts\\lib\\site-packages\\pandas\\util\\_decorators.py\u001b[0m in \u001b[0;36mwrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m    176\u001b[0m                 \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    177\u001b[0m                     \u001b[0mkwargs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mnew_arg_name\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnew_arg_value\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 178\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    179\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0mwrapper\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    180\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0m_deprecate_kwarg\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\envs\\Charts\\lib\\site-packages\\pandas\\io\\excel.py\u001b[0m in \u001b[0;36mread_excel\u001b[1;34m(io, sheet_name, header, names, index_col, usecols, squeeze, dtype, engine, converters, true_values, false_values, skiprows, nrows, na_values, parse_dates, date_parser, thousands, comment, skipfooter, convert_float, **kwds)\u001b[0m\n\u001b[0;32m    305\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    306\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mio\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mExcelFile\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 307\u001b[1;33m         \u001b[0mio\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mExcelFile\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mio\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mengine\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mengine\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    308\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    309\u001b[0m     return io.parse(\n",
      "\u001b[1;32m~\\Anaconda3\\envs\\Charts\\lib\\site-packages\\pandas\\io\\excel.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, io, **kwds)\u001b[0m\n\u001b[0;32m    392\u001b[0m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbook\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mxlrd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mopen_workbook\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfile_contents\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    393\u001b[0m         \u001b[1;32melif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_io\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcompat\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstring_types\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 394\u001b[1;33m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbook\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mxlrd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mopen_workbook\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_io\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    395\u001b[0m         \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    396\u001b[0m             raise ValueError('Must explicitly set engine if not passing in'\n",
      "\u001b[1;32m~\\Anaconda3\\envs\\Charts\\lib\\site-packages\\xlrd\\__init__.py\u001b[0m in \u001b[0;36mopen_workbook\u001b[1;34m(filename, logfile, verbosity, use_mmap, file_contents, encoding_override, formatting_info, on_demand, ragged_rows)\u001b[0m\n\u001b[0;32m    114\u001b[0m         \u001b[0mpeek\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfile_contents\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[0mpeeksz\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    115\u001b[0m     \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 116\u001b[1;33m         \u001b[1;32mwith\u001b[0m \u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"rb\"\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mf\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    117\u001b[0m             \u001b[0mpeek\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpeeksz\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    118\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[0mpeek\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34mb\"PK\\x03\\x04\"\u001b[0m\u001b[1;33m:\u001b[0m \u001b[1;31m# a ZIP file\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'world_leverage_ratio.xlsx'"
     ]
    }
   ],
   "source": [
    "leverage=pd.read_excel('world_leverage_ratio.xlsx')\n",
    "leverage"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"c5448b526014479588e6feb7158746d7\" style=\"width:1000px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_c5448b526014479588e6feb7158746d7 = echarts.init(document.getElementById('c5448b526014479588e6feb7158746d7'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_c5448b526014479588e6feb7158746d7 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5168\\u7403\\u4e3b\\u8981\\u56fd\\u5bb6\\u503a\\u52a1\\u5360\\u6bd4 \",\n",
       "            \"subtext\": \"2015\\u5e74\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 15\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 2279368,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u653f\\u5e9c\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "            \"data\": [\n",
       "                234.0,\n",
       "                132.0,\n",
       "                104.0,\n",
       "                139.0,\n",
       "                92.0,\n",
       "                89.0,\n",
       "                44.0,\n",
       "                70.0,\n",
       "                58.0,\n",
       "                31.0,\n",
       "                80.0,\n",
       "                65.0,\n",
       "                66.0,\n",
       "                9.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{c}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 2279368\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5c45\\u6c11\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "            \"data\": [\n",
       "                65.0,\n",
       "                73.0,\n",
       "                56.0,\n",
       "                43.0,\n",
       "                86.0,\n",
       "                77.0,\n",
       "                81.0,\n",
       "                92.0,\n",
       "                36.0,\n",
       "                113.0,\n",
       "                54.0,\n",
       "                25.0,\n",
       "                9.0,\n",
       "                16.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{c}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 2279368\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u975e\\u91d1\\u878d\\u4f01\\u4e1a\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "            \"data\": [\n",
       "                101.0,\n",
       "                108.0,\n",
       "                121.0,\n",
       "                77.0,\n",
       "                74.0,\n",
       "                67.0,\n",
       "                105.0,\n",
       "                60.0,\n",
       "                123.0,\n",
       "                69.0,\n",
       "                54.0,\n",
       "                38.0,\n",
       "                45.0,\n",
       "                40.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{c}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 2279368\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u603b\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "            \"data\": [\n",
       "                400.0,\n",
       "                313.0,\n",
       "                281.0,\n",
       "                259.0,\n",
       "                252.0,\n",
       "                233.0,\n",
       "                231.0,\n",
       "                221.0,\n",
       "                217.0,\n",
       "                213.0,\n",
       "                188.0,\n",
       "                128.0,\n",
       "                120.0,\n",
       "                65.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{c}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 2279368\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u653f\\u5e9c\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "                \"\\u5c45\\u6c11\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "                \"\\u975e\\u91d1\\u878d\\u4f01\\u4e1a\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "                \"\\u603b\\u503a\\u52a1\\u5360\\u6bd4\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u65e5\\u672c\",\n",
       "                \"\\u897f\\u73ed\\u7259\",\n",
       "                \"\\u6cd5\\u56fd\",\n",
       "                \"\\u610f\\u5927\\u5229\",\n",
       "                \"\\u82f1\\u56fd\",\n",
       "                \"\\u7f8e\\u56fd\",\n",
       "                \"\\u97e9\\u56fd\",\n",
       "                \"\\u52a0\\u62ff\\u5927\",\n",
       "                \"\\u4e2d\\u56fd\",\n",
       "                \"\\u6fb3\\u5927\\u5229\\u4e9a\",\n",
       "                \"\\u5fb7\\u56fd\",\n",
       "                \"\\u5df4\\u897f\",\n",
       "                \"\\u5370\\u5ea6\",\n",
       "                \"\\u4fc4\\u7f57\\u65af\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} %\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"dataZoom\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"type\": \"slider\",\n",
       "            \"start\": 50,\n",
       "            \"end\": 100,\n",
       "            \"orient\": \"horizontal\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "myChart_c5448b526014479588e6feb7158746d7.setOption(option_c5448b526014479588e6feb7158746d7);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.bar.Bar at 0x22587991c50>"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import *\n",
    "attr=list(leverage.index)\n",
    "v1=list(leverage['政府债务占比'].values)\n",
    "v2=list(leverage['居民债务占比'].values)\n",
    "v3=list(leverage['非金融企业债务占比'].values)\n",
    "v4=list(leverage['总债务占比'].values)\n",
    "\n",
    "bar = Bar(\"全球主要国家债务占比 \",\"2015年\",title_text_size=15,width=1000, height=400)\n",
    "bar.add(\"政府债务占比\", attr, v1,\n",
    "        is_datazoom_show=True,\n",
    "        is_label_show=True,is_splitline_show=False,\n",
    "        label_formatter='{c}%',yaxis_formatter=\"%\")\n",
    "bar.add(\"居民债务占比\", attr, v2,\n",
    "        is_label_show=True,is_splitline_show=False,\n",
    "        label_formatter='{c}%',yaxis_formatter=\"%\" )\n",
    "bar.add(\"非金融企业债务占比\", attr, v3,\n",
    "        is_label_show=True,is_splitline_show=False,\n",
    "        label_formatter='{c}%',yaxis_formatter=\"%\")\n",
    "bar.add(\"总债务占比\", attr, v4,\n",
    "        is_label_show=True,is_splitline_show=False,\n",
    "        label_formatter='{c}%',yaxis_formatter=\"%\" )\n",
    "bar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"a8168ccc95854e33b8049b73c8952895\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_a8168ccc95854e33b8049b73c8952895 = echarts.init(document.getElementById('a8168ccc95854e33b8049b73c8952895'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_a8168ccc95854e33b8049b73c8952895 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5168\\u7403\\u4e3b\\u8981\\u56fd\\u5bb6\\u503a\\u52a1/GDP\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 3259312,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u653f\\u5e9c\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "            \"data\": [\n",
       "                234.0,\n",
       "                132.0,\n",
       "                104.0,\n",
       "                139.0,\n",
       "                92.0,\n",
       "                89.0,\n",
       "                44.0,\n",
       "                70.0,\n",
       "                58.0,\n",
       "                31.0,\n",
       "                80.0,\n",
       "                65.0,\n",
       "                66.0,\n",
       "                9.0\n",
       "            ],\n",
       "            \"stack\": \"stack_3259312\",\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{c}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3259312\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5c45\\u6c11\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "            \"data\": [\n",
       "                65.0,\n",
       "                73.0,\n",
       "                56.0,\n",
       "                43.0,\n",
       "                86.0,\n",
       "                77.0,\n",
       "                81.0,\n",
       "                92.0,\n",
       "                36.0,\n",
       "                113.0,\n",
       "                54.0,\n",
       "                25.0,\n",
       "                9.0,\n",
       "                16.0\n",
       "            ],\n",
       "            \"stack\": \"stack_3259312\",\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{c}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3259312\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u975e\\u91d1\\u878d\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "            \"data\": [\n",
       "                101.0,\n",
       "                108.0,\n",
       "                121.0,\n",
       "                77.0,\n",
       "                74.0,\n",
       "                67.0,\n",
       "                105.0,\n",
       "                60.0,\n",
       "                123.0,\n",
       "                69.0,\n",
       "                54.0,\n",
       "                38.0,\n",
       "                45.0,\n",
       "                40.0\n",
       "            ],\n",
       "            \"stack\": \"stack_3259312\",\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{c}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3259312\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u603b\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "            \"data\": [\n",
       "                400.0,\n",
       "                313.0,\n",
       "                281.0,\n",
       "                259.0,\n",
       "                252.0,\n",
       "                233.0,\n",
       "                231.0,\n",
       "                221.0,\n",
       "                217.0,\n",
       "                213.0,\n",
       "                188.0,\n",
       "                128.0,\n",
       "                120.0,\n",
       "                65.0\n",
       "            ],\n",
       "            \"stack\": \"stack_3259312\",\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{c}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3259312\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u653f\\u5e9c\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "                \"\\u5c45\\u6c11\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "                \"\\u975e\\u91d1\\u878d\\u503a\\u52a1\\u5360\\u6bd4\",\n",
       "                \"\\u603b\\u503a\\u52a1\\u5360\\u6bd4\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"75%\",\n",
       "            \"top\": \"15%\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": 0,\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u65e5\\u672c\",\n",
       "                \"\\u897f\\u73ed\\u7259\",\n",
       "                \"\\u6cd5\\u56fd\",\n",
       "                \"\\u610f\\u5927\\u5229\",\n",
       "                \"\\u82f1\\u56fd\",\n",
       "                \"\\u7f8e\\u56fd\",\n",
       "                \"\\u97e9\\u56fd\",\n",
       "                \"\\u52a0\\u62ff\\u5927\",\n",
       "                \"\\u4e2d\\u56fd\",\n",
       "                \"\\u6fb3\\u5927\\u5229\\u4e9a\",\n",
       "                \"\\u5fb7\\u56fd\",\n",
       "                \"\\u5df4\\u897f\",\n",
       "                \"\\u5370\\u5ea6\",\n",
       "                \"\\u4fc4\\u7f57\\u65af\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_a8168ccc95854e33b8049b73c8952895.setOption(option_a8168ccc95854e33b8049b73c8952895);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.bar.Bar at 0x225884d6128>"
      ]
     },
     "execution_count": 186,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import *\n",
    "attr=list(leverage.index)\n",
    "v1=list(leverage['政府债务占比'].values)\n",
    "v2=list(leverage['居民债务占比'].values)\n",
    "v3=list(leverage['非金融企业债务占比'].values)\n",
    "v4=list(leverage['总债务占比'].values)\n",
    "#全球主要国家债务占比 title_text_size=15,\n",
    "bar = Bar(\"全球主要国家债务/GDP\",title_pos = 'center')\n",
    "bar.add(\"政府债务占比\", attr, v1,\n",
    "        is_stack=True,\n",
    "        is_label_show=True,is_splitline_show=False,\n",
    "        label_formatter='{c}%',is_yaxis_show=False,\n",
    "        xaxis_interval=0,\n",
    "        legend_pos = '75%')\n",
    "bar.add(\"居民债务占比\", attr, v2,\n",
    "        is_label_show=True,is_stack=True,\n",
    "        is_splitline_show=False,\n",
    "        label_formatter='{c}%',is_yaxis_show=False,\n",
    "        xaxis_interval=0,\n",
    "        legend_pos = '75%')\n",
    "bar.add(\"非金融债务占比\", attr, v3,\n",
    "        is_label_show=True,is_stack=True,\n",
    "        is_splitline_show=False,\n",
    "        label_formatter='{c}%',is_yaxis_show=False,\n",
    "        xaxis_interval=0,\n",
    "        legend_pos = '75%')\n",
    "bar.add(\"总债务占比\", attr, v4,\n",
    "        is_label_show=True,is_stack=True,\n",
    "        is_splitline_show=False,\n",
    "        label_formatter='{c}%',is_yaxis_show=False,\n",
    "        xaxis_interval=0,legend_pos = '75%',legend_top=\"15%\",)\n",
    "#,yaxis_formatter=\"%\" \n",
    "#legend_orient = 'vertical', #图例垂直\n",
    "bar.render('全球主要国家债务占比.html')\n",
    "bar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>地区</th>\n",
       "      <th>金融租赁</th>\n",
       "      <th>内资租赁</th>\n",
       "      <th>外资租赁</th>\n",
       "      <th>总数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>广东</td>\n",
       "      <td>6</td>\n",
       "      <td>29</td>\n",
       "      <td>3733</td>\n",
       "      <td>3768</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海</td>\n",
       "      <td>10</td>\n",
       "      <td>25</td>\n",
       "      <td>2160</td>\n",
       "      <td>2195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>天津</td>\n",
       "      <td>11</td>\n",
       "      <td>94</td>\n",
       "      <td>1722</td>\n",
       "      <td>1827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>辽宁</td>\n",
       "      <td>1</td>\n",
       "      <td>32</td>\n",
       "      <td>716</td>\n",
       "      <td>749</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>福建</td>\n",
       "      <td>2</td>\n",
       "      <td>10</td>\n",
       "      <td>381</td>\n",
       "      <td>393</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   地区  金融租赁  内资租赁  外资租赁    总数\n",
       "0  广东     6    29  3733  3768\n",
       "1  上海    10    25  2160  2195\n",
       "2  天津    11    94  1722  1827\n",
       "3  辽宁     1    32   716   749\n",
       "4  福建     2    10   381   393"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "totals=pd.read_excel('融资租赁分布.xlsx')\n",
    "totals.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 165,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min', 'china': '/nbextensions/echarts-countries-js/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"2ff4f32e28de4f3a98fc59eac624e225\" style=\"width:1200px;height:600px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts', 'china'], function(echarts) {\n",
       "        \n",
       "var myChart_2ff4f32e28de4f3a98fc59eac624e225 = echarts.init(document.getElementById('2ff4f32e28de4f3a98fc59eac624e225'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_2ff4f32e28de4f3a98fc59eac624e225 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5168\\u56fd\\u5730\\u56fe\\u793a\\u4f8b\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 7397837,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"symbol\": \"circle\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"mapType\": \"china\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": 3768.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": 2195.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6d25\",\n",
       "                    \"value\": 1827.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8fbd\\u5b81\",\n",
       "                    \"value\": 749.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5efa\",\n",
       "                    \"value\": 393.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": 389.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u4e1c\",\n",
       "                    \"value\": 333.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": 288.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": 255.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9655\\u897f\",\n",
       "                    \"value\": 201.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": 83.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u56db\\u5ddd\",\n",
       "                    \"value\": 60.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5fbd\",\n",
       "                    \"value\": 57.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5317\",\n",
       "                    \"value\": 55.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65b0\\u7586\",\n",
       "                    \"value\": 41.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5357\",\n",
       "                    \"value\": 34.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5317\",\n",
       "                    \"value\": 27.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": 22.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e91\\u5357\",\n",
       "                    \"value\": 20.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": 16.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"value\": 16.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ed1\\u9f99\\u6c5f\",\n",
       "                    \"value\": 12.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5185\\u8499\\u53e4\",\n",
       "                    \"value\": 9.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d35\\u5dde\",\n",
       "                    \"value\": 7.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9752\\u6d77\",\n",
       "                    \"value\": 6.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d77\\u5357\",\n",
       "                    \"value\": 6.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u897f\\u85cf\",\n",
       "                    \"value\": 5.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u897f\",\n",
       "                    \"value\": 5.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b81\\u590f\",\n",
       "                    \"value\": 4.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7518\\u8083\",\n",
       "                    \"value\": 4.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5409\\u6797\",\n",
       "                    \"value\": 4.0\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"showLegendSymbol\": true\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 4.0,\n",
       "        \"max\": 3768.0,\n",
       "        \"text\": [\n",
       "            \"high\",\n",
       "            \"low\"\n",
       "        ],\n",
       "        \"textStyle\": {},\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"left\",\n",
       "        \"top\": \"bottom\",\n",
       "        \"showLabel\": true\n",
       "    }\n",
       "};\n",
       "myChart_2ff4f32e28de4f3a98fc59eac624e225.setOption(option_2ff4f32e28de4f3a98fc59eac624e225);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.map.Map at 0x2258808f080>"
      ]
     },
     "execution_count": 165,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Map\n",
    "value =list(totals['总数'].values)\n",
    "attr = list(totals['地区'].values)\n",
    "map = Map('全国地图示例',width = 1200,height = 600)\n",
    "map.add('',attr,value,maptype = 'china',\n",
    "        visual_range=[min(value),max(value)],\n",
    "       \n",
    "        is_label_show=True,is_visualmap=True,)\n",
    "map"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "metadata": {},
   "outputs": [],
   "source": [
    "others=totals.loc[10:,'总数'].sum()\n",
    "values=list(totals['总数'][:10])\n",
    "values.append(others)\n",
    "attr=list(totals['地区'][:10])\n",
    "attr.append('其他')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"b6f22907001d46e6b20e29d6cd08ecd5\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_b6f22907001d46e6b20e29d6cd08ecd5 = echarts.init(document.getElementById('b6f22907001d46e6b20e29d6cd08ecd5'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_b6f22907001d46e6b20e29d6cd08ecd5 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u878d\\u8d44\\u79df\\u8d41\\u4f01\\u4e1a\\u5730\\u533a\\u5206\\u5e03\",\n",
       "            \"subtext\": \"2018\\u5e746\\u670830\\u65e5\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 15\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 6934303,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": 3768\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": 2195\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6d25\",\n",
       "                    \"value\": 1827\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8fbd\\u5b81\",\n",
       "                    \"value\": 749\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5efa\",\n",
       "                    \"value\": 393\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": 389\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u4e1c\",\n",
       "                    \"value\": 333\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": 288\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": 255\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9655\\u897f\",\n",
       "                    \"value\": 201\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5176\\u4ed6\",\n",
       "                    \"value\": 493.0\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"outside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                }\n",
       "            },\n",
       "            \"seriesId\": 6934303\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5e7f\\u4e1c\",\n",
       "                \"\\u4e0a\\u6d77\",\n",
       "                \"\\u5929\\u6d25\",\n",
       "                \"\\u8fbd\\u5b81\",\n",
       "                \"\\u798f\\u5efa\",\n",
       "                \"\\u6d59\\u6c5f\",\n",
       "                \"\\u5c71\\u4e1c\",\n",
       "                \"\\u6c5f\\u82cf\",\n",
       "                \"\\u5317\\u4eac\",\n",
       "                \"\\u9655\\u897f\",\n",
       "                \"\\u5176\\u4ed6\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": false,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_b6f22907001d46e6b20e29d6cd08ecd5.setOption(option_b6f22907001d46e6b20e29d6cd08ecd5);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.pie.Pie at 0x22588330c50>"
      ]
     },
     "execution_count": 149,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Pie\n",
    "\n",
    "pie = Pie('融资租赁企业地区分布','2018年6月30日',title_pos='center',title_text_size=15)\n",
    "pie.add('',attr,values,is_label_show = True,\n",
    "       is_legend_show=False)\n",
    "pie"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "71.52"
      ]
     },
     "execution_count": 166,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "34.6+20.15+16.77"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"f1d864a73f7246038e131c94a3caf75f\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_f1d864a73f7246038e131c94a3caf75f = echarts.init(document.getElementById('f1d864a73f7246038e131c94a3caf75f'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_f1d864a73f7246038e131c94a3caf75f = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 6181596,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"formatter\": \"{a} <br/>{b} : {c}%\",\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"gauge\",\n",
       "            \"detail\": {\n",
       "                \"formatter\": \"{value}%\"\n",
       "            },\n",
       "            \"name\": \"\\u5e7f\\u4e1c+\\u4e0a\\u6d77+\\u5929\\u6d25\\n\\u878d\\u8d44\\u79df\\u8d41\\u516c\\u53f8\\u603b\\u6570\",\n",
       "            \"min\": 0,\n",
       "            \"max\": 100,\n",
       "            \"startAngle\": 225,\n",
       "            \"endAngle\": -45,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"value\": 71.52,\n",
       "                    \"name\": \"\\u5360\\u6bd4\"\n",
       "                }\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5e7f\\u4e1c+\\u4e0a\\u6d77+\\u5929\\u6d25\\n\\u878d\\u8d44\\u79df\\u8d41\\u516c\\u53f8\\u603b\\u6570\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_f1d864a73f7246038e131c94a3caf75f.setOption(option_f1d864a73f7246038e131c94a3caf75f);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.gauge.Gauge at 0x22587f53978>"
      ]
     },
     "execution_count": 175,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Gauge\n",
    "\n",
    "gauge = Gauge(\"\")\n",
    "gauge.add(\"广东+上海+天津\\n融资租赁公司总数\", \"占比\", 71.52)\n",
    "\n",
    "gauge"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [],
   "source": [
    "file='C:\\\\Users\\\\zjy\\\\Desktop\\\\融资租赁\\\\'\n",
    "df=pd.read_excel(file+'融资租赁数据.xls')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>年</th>\n",
       "      <th>企业数</th>\n",
       "      <th>金融租赁</th>\n",
       "      <th>内资租赁</th>\n",
       "      <th>外资租赁</th>\n",
       "      <th>企业数同比</th>\n",
       "      <th>金融租赁同比</th>\n",
       "      <th>内资租赁同比</th>\n",
       "      <th>外资租赁同比</th>\n",
       "      <th>合同余额</th>\n",
       "      <th>金融租赁合同余额</th>\n",
       "      <th>内资租赁合同余额</th>\n",
       "      <th>外资租赁合同余额</th>\n",
       "      <th>合同余额同比</th>\n",
       "      <th>金融租赁合同余额同比</th>\n",
       "      <th>内资租赁合同余额同比</th>\n",
       "      <th>外资租赁合同余额同比</th>\n",
       "      <th>金融租赁合同余额占比</th>\n",
       "      <th>内资租赁合同余额占比</th>\n",
       "      <th>外资租赁合同余额占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2008</td>\n",
       "      <td>142</td>\n",
       "      <td>12</td>\n",
       "      <td>36</td>\n",
       "      <td>94</td>\n",
       "      <td>30.280000</td>\n",
       "      <td>9.09</td>\n",
       "      <td>44.00000</td>\n",
       "      <td>28.770000</td>\n",
       "      <td>1550</td>\n",
       "      <td>420</td>\n",
       "      <td>630</td>\n",
       "      <td>500</td>\n",
       "      <td>545.830000</td>\n",
       "      <td>366.67000</td>\n",
       "      <td>530.000000</td>\n",
       "      <td>900.000000</td>\n",
       "      <td>27.100000</td>\n",
       "      <td>40.650000</td>\n",
       "      <td>32.26000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2009</td>\n",
       "      <td>170</td>\n",
       "      <td>12</td>\n",
       "      <td>44</td>\n",
       "      <td>114</td>\n",
       "      <td>19.720000</td>\n",
       "      <td>0.00</td>\n",
       "      <td>22.22000</td>\n",
       "      <td>21.280000</td>\n",
       "      <td>3700</td>\n",
       "      <td>1700</td>\n",
       "      <td>1300</td>\n",
       "      <td>700</td>\n",
       "      <td>139.000000</td>\n",
       "      <td>305.00000</td>\n",
       "      <td>106.000000</td>\n",
       "      <td>40.000000</td>\n",
       "      <td>46.000000</td>\n",
       "      <td>35.000000</td>\n",
       "      <td>19.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2010</td>\n",
       "      <td>233</td>\n",
       "      <td>17</td>\n",
       "      <td>44</td>\n",
       "      <td>172</td>\n",
       "      <td>37.060000</td>\n",
       "      <td>41.67</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>50.880000</td>\n",
       "      <td>7000</td>\n",
       "      <td>3500</td>\n",
       "      <td>2200</td>\n",
       "      <td>1300</td>\n",
       "      <td>89.000000</td>\n",
       "      <td>106.00000</td>\n",
       "      <td>54.000000</td>\n",
       "      <td>86.000000</td>\n",
       "      <td>50.000000</td>\n",
       "      <td>31.000000</td>\n",
       "      <td>19.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2011</td>\n",
       "      <td>369</td>\n",
       "      <td>20</td>\n",
       "      <td>66</td>\n",
       "      <td>283</td>\n",
       "      <td>58.370000</td>\n",
       "      <td>17.65</td>\n",
       "      <td>50.00000</td>\n",
       "      <td>64.530000</td>\n",
       "      <td>9300</td>\n",
       "      <td>3900</td>\n",
       "      <td>3200</td>\n",
       "      <td>2200</td>\n",
       "      <td>32.900000</td>\n",
       "      <td>11.40000</td>\n",
       "      <td>45.500000</td>\n",
       "      <td>69.200000</td>\n",
       "      <td>41.900000</td>\n",
       "      <td>34.400000</td>\n",
       "      <td>23.70000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2012</td>\n",
       "      <td>643</td>\n",
       "      <td>20</td>\n",
       "      <td>79</td>\n",
       "      <td>544</td>\n",
       "      <td>74.250000</td>\n",
       "      <td>0.00</td>\n",
       "      <td>19.70000</td>\n",
       "      <td>92.230000</td>\n",
       "      <td>15500</td>\n",
       "      <td>6600</td>\n",
       "      <td>5400</td>\n",
       "      <td>3500</td>\n",
       "      <td>66.700000</td>\n",
       "      <td>69.20000</td>\n",
       "      <td>68.800000</td>\n",
       "      <td>59.100000</td>\n",
       "      <td>42.600000</td>\n",
       "      <td>34.800000</td>\n",
       "      <td>22.60000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2013</td>\n",
       "      <td>1106</td>\n",
       "      <td>23</td>\n",
       "      <td>123</td>\n",
       "      <td>960</td>\n",
       "      <td>72.010000</td>\n",
       "      <td>15.00</td>\n",
       "      <td>55.70000</td>\n",
       "      <td>76.470000</td>\n",
       "      <td>21000</td>\n",
       "      <td>8600</td>\n",
       "      <td>6900</td>\n",
       "      <td>5500</td>\n",
       "      <td>35.500000</td>\n",
       "      <td>30.30000</td>\n",
       "      <td>27.800000</td>\n",
       "      <td>57.100000</td>\n",
       "      <td>40.900000</td>\n",
       "      <td>32.900000</td>\n",
       "      <td>26.20000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2014</td>\n",
       "      <td>2202</td>\n",
       "      <td>30</td>\n",
       "      <td>152</td>\n",
       "      <td>2020</td>\n",
       "      <td>99.100000</td>\n",
       "      <td>30.43</td>\n",
       "      <td>23.58000</td>\n",
       "      <td>110.420000</td>\n",
       "      <td>32000</td>\n",
       "      <td>13000</td>\n",
       "      <td>10000</td>\n",
       "      <td>9000</td>\n",
       "      <td>52.400000</td>\n",
       "      <td>51.20000</td>\n",
       "      <td>44.900000</td>\n",
       "      <td>63.600000</td>\n",
       "      <td>40.600000</td>\n",
       "      <td>31.300000</td>\n",
       "      <td>28.10000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2015</td>\n",
       "      <td>4508</td>\n",
       "      <td>47</td>\n",
       "      <td>190</td>\n",
       "      <td>4271</td>\n",
       "      <td>104.720000</td>\n",
       "      <td>56.67</td>\n",
       "      <td>25.00000</td>\n",
       "      <td>111.440000</td>\n",
       "      <td>44400</td>\n",
       "      <td>17300</td>\n",
       "      <td>13000</td>\n",
       "      <td>14100</td>\n",
       "      <td>38.750000</td>\n",
       "      <td>33.08000</td>\n",
       "      <td>30.000000</td>\n",
       "      <td>56.670000</td>\n",
       "      <td>38.960000</td>\n",
       "      <td>29.280000</td>\n",
       "      <td>31.76000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2016</td>\n",
       "      <td>7136</td>\n",
       "      <td>59</td>\n",
       "      <td>205</td>\n",
       "      <td>6872</td>\n",
       "      <td>58.300000</td>\n",
       "      <td>25.53</td>\n",
       "      <td>7.89000</td>\n",
       "      <td>60.900000</td>\n",
       "      <td>53300</td>\n",
       "      <td>20400</td>\n",
       "      <td>16200</td>\n",
       "      <td>16700</td>\n",
       "      <td>20.050000</td>\n",
       "      <td>17.92000</td>\n",
       "      <td>24.620000</td>\n",
       "      <td>18.440000</td>\n",
       "      <td>38.270000</td>\n",
       "      <td>30.390000</td>\n",
       "      <td>31.33000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2017</td>\n",
       "      <td>9090</td>\n",
       "      <td>69</td>\n",
       "      <td>276</td>\n",
       "      <td>8745</td>\n",
       "      <td>27.400000</td>\n",
       "      <td>16.90</td>\n",
       "      <td>35.30000</td>\n",
       "      <td>27.100000</td>\n",
       "      <td>60600</td>\n",
       "      <td>22800</td>\n",
       "      <td>18800</td>\n",
       "      <td>19000</td>\n",
       "      <td>13.700000</td>\n",
       "      <td>11.80000</td>\n",
       "      <td>16.000000</td>\n",
       "      <td>13.800000</td>\n",
       "      <td>37.620000</td>\n",
       "      <td>31.020000</td>\n",
       "      <td>31.35000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2018Q3</td>\n",
       "      <td>11565</td>\n",
       "      <td>69</td>\n",
       "      <td>397</td>\n",
       "      <td>11099</td>\n",
       "      <td>27.227723</td>\n",
       "      <td>0.00</td>\n",
       "      <td>43.84058</td>\n",
       "      <td>26.918239</td>\n",
       "      <td>65300</td>\n",
       "      <td>24500</td>\n",
       "      <td>20600</td>\n",
       "      <td>20200</td>\n",
       "      <td>7.755776</td>\n",
       "      <td>7.45614</td>\n",
       "      <td>9.574468</td>\n",
       "      <td>6.315789</td>\n",
       "      <td>37.519142</td>\n",
       "      <td>31.546708</td>\n",
       "      <td>30.93415</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         年    企业数  金融租赁  内资租赁   外资租赁       企业数同比  金融租赁同比    内资租赁同比  \\\n",
       "0     2008    142    12    36     94   30.280000    9.09  44.00000   \n",
       "1     2009    170    12    44    114   19.720000    0.00  22.22000   \n",
       "2     2010    233    17    44    172   37.060000   41.67   0.00000   \n",
       "3     2011    369    20    66    283   58.370000   17.65  50.00000   \n",
       "4     2012    643    20    79    544   74.250000    0.00  19.70000   \n",
       "5     2013   1106    23   123    960   72.010000   15.00  55.70000   \n",
       "6     2014   2202    30   152   2020   99.100000   30.43  23.58000   \n",
       "7     2015   4508    47   190   4271  104.720000   56.67  25.00000   \n",
       "8     2016   7136    59   205   6872   58.300000   25.53   7.89000   \n",
       "9     2017   9090    69   276   8745   27.400000   16.90  35.30000   \n",
       "10  2018Q3  11565    69   397  11099   27.227723    0.00  43.84058   \n",
       "\n",
       "        外资租赁同比   合同余额  金融租赁合同余额  内资租赁合同余额  外资租赁合同余额      合同余额同比  金融租赁合同余额同比  \\\n",
       "0    28.770000   1550       420       630       500  545.830000   366.67000   \n",
       "1    21.280000   3700      1700      1300       700  139.000000   305.00000   \n",
       "2    50.880000   7000      3500      2200      1300   89.000000   106.00000   \n",
       "3    64.530000   9300      3900      3200      2200   32.900000    11.40000   \n",
       "4    92.230000  15500      6600      5400      3500   66.700000    69.20000   \n",
       "5    76.470000  21000      8600      6900      5500   35.500000    30.30000   \n",
       "6   110.420000  32000     13000     10000      9000   52.400000    51.20000   \n",
       "7   111.440000  44400     17300     13000     14100   38.750000    33.08000   \n",
       "8    60.900000  53300     20400     16200     16700   20.050000    17.92000   \n",
       "9    27.100000  60600     22800     18800     19000   13.700000    11.80000   \n",
       "10   26.918239  65300     24500     20600     20200    7.755776     7.45614   \n",
       "\n",
       "    内资租赁合同余额同比  外资租赁合同余额同比  金融租赁合同余额占比  内资租赁合同余额占比  外资租赁合同余额占比  \n",
       "0   530.000000  900.000000   27.100000   40.650000    32.26000  \n",
       "1   106.000000   40.000000   46.000000   35.000000    19.00000  \n",
       "2    54.000000   86.000000   50.000000   31.000000    19.00000  \n",
       "3    45.500000   69.200000   41.900000   34.400000    23.70000  \n",
       "4    68.800000   59.100000   42.600000   34.800000    22.60000  \n",
       "5    27.800000   57.100000   40.900000   32.900000    26.20000  \n",
       "6    44.900000   63.600000   40.600000   31.300000    28.10000  \n",
       "7    30.000000   56.670000   38.960000   29.280000    31.76000  \n",
       "8    24.620000   18.440000   38.270000   30.390000    31.33000  \n",
       "9    16.000000   13.800000   37.620000   31.020000    31.35000  \n",
       "10    9.574468    6.315789   37.519142   31.546708    30.93415  "
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 全国租赁行业企业数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 全国租赁行业企业数量\n",
    "from pyecharts import *\n",
    "grid = Grid()\n",
    "\n",
    "attr = list(df['年'])\n",
    "v0= list(df['企业数'].values)\n",
    "l0=list((df['企业数同比'].values).round(2))\n",
    "bar = Bar(\"\")\n",
    "bar.add('全国租赁企业数量（家）',attr,v0,is_label_show=True,is_splitline_show=False,)\n",
    "\n",
    "line = Line()\n",
    "line.add(\"同比增长(%)\", attr,l0,is_label_show=True,is_splitline_show=False,)\n",
    "\n",
    "overlap = Overlap(width=1200, height=600)\n",
    "overlap.add(bar)\n",
    "overlap.add(line, is_add_yaxis=True, yaxis_index=1)\n",
    "\n",
    "grid.add(overlap, grid_right=\"9%\")\n",
    "grid"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 租赁业务规模（合同余额）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"e0ec169aeb69488e9d7cd1dfabd403fa\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_e0ec169aeb69488e9d7cd1dfabd403fa = echarts.init(document.getElementById('e0ec169aeb69488e9d7cd1dfabd403fa'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_e0ec169aeb69488e9d7cd1dfabd403fa = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 2919001,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5168\\u56fd\\u79df\\u8d41\\u5408\\u540c\\u4f59\\u989d\\uff08\\u4ebf\\u5143\\uff09\",\n",
       "            \"data\": [\n",
       "                1550.0,\n",
       "                3700.0,\n",
       "                7000.0,\n",
       "                9300.0,\n",
       "                15500.0,\n",
       "                21000.0,\n",
       "                32000.0,\n",
       "                44400.0,\n",
       "                53300.0,\n",
       "                60600.0,\n",
       "                65300.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 2919001\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"2008\",\n",
       "                    545.83\n",
       "                ],\n",
       "                [\n",
       "                    \"2009\",\n",
       "                    139.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2010\",\n",
       "                    89.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2011\",\n",
       "                    32.9\n",
       "                ],\n",
       "                [\n",
       "                    \"2012\",\n",
       "                    66.7\n",
       "                ],\n",
       "                [\n",
       "                    \"2013\",\n",
       "                    35.5\n",
       "                ],\n",
       "                [\n",
       "                    \"2014\",\n",
       "                    52.4\n",
       "                ],\n",
       "                [\n",
       "                    \"2015\",\n",
       "                    38.75\n",
       "                ],\n",
       "                [\n",
       "                    \"2016\",\n",
       "                    20.05\n",
       "                ],\n",
       "                [\n",
       "                    \"2017\",\n",
       "                    13.7\n",
       "                ],\n",
       "                [\n",
       "                    \"2018Q3\",\n",
       "                    7.76\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 2919001,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 1\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5168\\u56fd\\u79df\\u8d41\\u5408\\u540c\\u4f59\\u989d\\uff08\\u4ebf\\u5143\\uff09\",\n",
       "                \"\\u540c\\u6bd4\\u589e\\u957f(%)\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"2008\",\n",
       "                \"2009\",\n",
       "                \"2010\",\n",
       "                \"2011\",\n",
       "                \"2012\",\n",
       "                \"2013\",\n",
       "                \"2014\",\n",
       "                \"2015\",\n",
       "                \"2016\",\n",
       "                \"2017\",\n",
       "                \"2018Q3\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "myChart_e0ec169aeb69488e9d7cd1dfabd403fa.setOption(option_e0ec169aeb69488e9d7cd1dfabd403fa);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.custom.grid.Grid at 0x15dd72d1748>"
      ]
     },
     "execution_count": 122,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#全国租赁行业企业数量\n",
    "from pyecharts import *\n",
    "grid = Grid()\n",
    "\n",
    "attr = list(df['年'])\n",
    "v0= list(df['合同余额'].values)\n",
    "l0=list((df['合同余额同比'].values).round(2))\n",
    "bar = Bar(\"\")\n",
    "bar.add('全国租赁合同余额（亿元）',attr,v0,is_label_show=True,\n",
    "        is_splitline_show=False,)\n",
    "\n",
    "line = Line()\n",
    "line.add(\"同比增长(%)\", attr,l0,is_label_show=True,is_splitline_show=False,)\n",
    "\n",
    "overlap = Overlap(width=1200, height=600)\n",
    "overlap.add(bar)\n",
    "overlap.add(line, is_add_yaxis=True, yaxis_index=1)\n",
    "\n",
    "grid.add(overlap, grid_right=\"9%\")\n",
    "grid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 146,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"7bf0becbd80842e5841d615148331101\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_7bf0becbd80842e5841d615148331101 = echarts.init(document.getElementById('7bf0becbd80842e5841d615148331101'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_7bf0becbd80842e5841d615148331101 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 3087372,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u91d1\\u878d\\u79df\\u8d41\",\n",
       "            \"data\": [\n",
       "                420.0,\n",
       "                1700.0,\n",
       "                3500.0,\n",
       "                3900.0,\n",
       "                6600.0,\n",
       "                8600.0,\n",
       "                13000.0,\n",
       "                17300.0,\n",
       "                20400.0,\n",
       "                22800.0,\n",
       "                24500.0\n",
       "            ],\n",
       "            \"stack\": \"stack_3087372\",\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3087372\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5185\\u8d44\\u79df\\u8d41\",\n",
       "            \"data\": [\n",
       "                630.0,\n",
       "                1300.0,\n",
       "                2200.0,\n",
       "                3200.0,\n",
       "                5400.0,\n",
       "                6900.0,\n",
       "                10000.0,\n",
       "                13000.0,\n",
       "                16200.0,\n",
       "                18800.0,\n",
       "                20600.0\n",
       "            ],\n",
       "            \"stack\": \"stack_3087372\",\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3087372\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5916\\u8d44\\u79df\\u8d41\",\n",
       "            \"data\": [\n",
       "                500.0,\n",
       "                700.0,\n",
       "                1300.0,\n",
       "                2200.0,\n",
       "                3500.0,\n",
       "                5500.0,\n",
       "                9000.0,\n",
       "                14100.0,\n",
       "                16700.0,\n",
       "                19000.0,\n",
       "                20200.0\n",
       "            ],\n",
       "            \"stack\": \"stack_3087372\",\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3087372\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u91d1\\u878d\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"2008\",\n",
       "                    366.67\n",
       "                ],\n",
       "                [\n",
       "                    \"2009\",\n",
       "                    305.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2010\",\n",
       "                    106.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2011\",\n",
       "                    11.4\n",
       "                ],\n",
       "                [\n",
       "                    \"2012\",\n",
       "                    69.2\n",
       "                ],\n",
       "                [\n",
       "                    \"2013\",\n",
       "                    30.3\n",
       "                ],\n",
       "                [\n",
       "                    \"2014\",\n",
       "                    51.2\n",
       "                ],\n",
       "                [\n",
       "                    \"2015\",\n",
       "                    33.08\n",
       "                ],\n",
       "                [\n",
       "                    \"2016\",\n",
       "                    17.92\n",
       "                ],\n",
       "                [\n",
       "                    \"2017\",\n",
       "                    11.8\n",
       "                ],\n",
       "                [\n",
       "                    \"2018Q3\",\n",
       "                    7.46\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3087372,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 1\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5185\\u8d44\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"2008\",\n",
       "                    530.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2009\",\n",
       "                    106.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2010\",\n",
       "                    54.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2011\",\n",
       "                    45.5\n",
       "                ],\n",
       "                [\n",
       "                    \"2012\",\n",
       "                    68.8\n",
       "                ],\n",
       "                [\n",
       "                    \"2013\",\n",
       "                    27.8\n",
       "                ],\n",
       "                [\n",
       "                    \"2014\",\n",
       "                    44.9\n",
       "                ],\n",
       "                [\n",
       "                    \"2015\",\n",
       "                    30.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2016\",\n",
       "                    24.62\n",
       "                ],\n",
       "                [\n",
       "                    \"2017\",\n",
       "                    16.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2018Q3\",\n",
       "                    9.57\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3087372,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 1\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5916\\u8d44\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"2008\",\n",
       "                    900.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2009\",\n",
       "                    40.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2010\",\n",
       "                    86.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2011\",\n",
       "                    69.2\n",
       "                ],\n",
       "                [\n",
       "                    \"2012\",\n",
       "                    59.1\n",
       "                ],\n",
       "                [\n",
       "                    \"2013\",\n",
       "                    57.1\n",
       "                ],\n",
       "                [\n",
       "                    \"2014\",\n",
       "                    63.6\n",
       "                ],\n",
       "                [\n",
       "                    \"2015\",\n",
       "                    56.67\n",
       "                ],\n",
       "                [\n",
       "                    \"2016\",\n",
       "                    18.44\n",
       "                ],\n",
       "                [\n",
       "                    \"2017\",\n",
       "                    13.8\n",
       "                ],\n",
       "                [\n",
       "                    \"2018Q3\",\n",
       "                    6.32\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3087372,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 1\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u91d1\\u878d\\u79df\\u8d41\",\n",
       "                \"\\u5185\\u8d44\\u79df\\u8d41\",\n",
       "                \"\\u5916\\u8d44\\u79df\\u8d41\",\n",
       "                \"\\u91d1\\u878d\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "                \"\\u5185\\u8d44\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "                \"\\u5916\\u8d44\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"2008\",\n",
       "                \"2009\",\n",
       "                \"2010\",\n",
       "                \"2011\",\n",
       "                \"2012\",\n",
       "                \"2013\",\n",
       "                \"2014\",\n",
       "                \"2015\",\n",
       "                \"2016\",\n",
       "                \"2017\",\n",
       "                \"2018Q3\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "myChart_7bf0becbd80842e5841d615148331101.setOption(option_7bf0becbd80842e5841d615148331101);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.custom.grid.Grid at 0x15dd72f0fd0>"
      ]
     },
     "execution_count": 146,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import *\n",
    "grid = Grid()\n",
    "\n",
    "attr = list(df['年'])\n",
    "\n",
    "v1 =list(df['金融租赁合同余额'].values)\n",
    "v2 = list(df['内资租赁合同余额'].values) \n",
    "v3 =list(df['外资租赁合同余额'].values)\n",
    "\n",
    "bar = Bar(\"\")\n",
    "\n",
    "bar.add(\"金融租赁\", attr, v1, is_stack=True,is_label_show=True,\n",
    "       is_splitline_show=False,label_pos=\"inside\",)\n",
    "bar.add(\"内资租赁\", attr, v2, is_stack=True,is_label_show=True,\n",
    "       is_splitline_show=False,label_pos=\"inside\",)\n",
    "bar.add(\"外资租赁\", attr, v3, is_stack=True,is_label_show=True,\n",
    "       is_splitline_show=False,label_pos=\"inside\",)\n",
    "\n",
    "v4=list((df['金融租赁合同余额同比'].values).round(2))\n",
    "v5=list((df['内资租赁合同余额同比'].values).round(2))\n",
    "v6=list((df['外资租赁合同余额同比'].values).round(2))\n",
    "\n",
    "line = Line()\n",
    "line.add(\"金融租赁同比增长(%)\", attr,v4,is_splitline_show=False,\n",
    "         is_smooth=True,)\n",
    "line.add(\"内资租赁同比增长(%)\", attr,v5,is_splitline_show=False,\n",
    "         is_smooth=True,)\n",
    "line.add(\"外资租赁同比增长(%)\", attr,v6,is_splitline_show=False,\n",
    "         is_smooth=True,)\n",
    "\n",
    "overlap = Overlap(width=1200, height=600)\n",
    "overlap.add(bar)\n",
    "overlap.add(line, is_add_yaxis=True, yaxis_index=1)\n",
    "\n",
    "grid.add(overlap, grid_right=\"9%\")\n",
    "grid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"8db4bcb7f55d47afa753ca25a6129a3d\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_8db4bcb7f55d47afa753ca25a6129a3d = echarts.init(document.getElementById('8db4bcb7f55d47afa753ca25a6129a3d'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_8db4bcb7f55d47afa753ca25a6129a3d = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 4189723,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u91d1\\u878d\\u79df\\u8d41\",\n",
       "            \"data\": [\n",
       "                12.0,\n",
       "                12.0,\n",
       "                17.0,\n",
       "                20.0,\n",
       "                20.0,\n",
       "                23.0,\n",
       "                30.0,\n",
       "                47.0,\n",
       "                59.0,\n",
       "                69.0,\n",
       "                69.0\n",
       "            ],\n",
       "            \"stack\": \"stack_4189723\",\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4189723\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5185\\u8d44\\u79df\\u8d41\",\n",
       "            \"data\": [\n",
       "                36.0,\n",
       "                44.0,\n",
       "                44.0,\n",
       "                66.0,\n",
       "                79.0,\n",
       "                123.0,\n",
       "                152.0,\n",
       "                190.0,\n",
       "                205.0,\n",
       "                276.0,\n",
       "                397.0\n",
       "            ],\n",
       "            \"stack\": \"stack_4189723\",\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4189723\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5916\\u8d44\\u79df\\u8d41\",\n",
       "            \"data\": [\n",
       "                94.0,\n",
       "                114.0,\n",
       "                172.0,\n",
       "                283.0,\n",
       "                544.0,\n",
       "                960.0,\n",
       "                2020.0,\n",
       "                4271.0,\n",
       "                6872.0,\n",
       "                8745.0,\n",
       "                11099.0\n",
       "            ],\n",
       "            \"stack\": \"stack_4189723\",\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4189723\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u91d1\\u878d\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"2008\",\n",
       "                    9.09\n",
       "                ],\n",
       "                [\n",
       "                    \"2009\",\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2010\",\n",
       "                    41.67\n",
       "                ],\n",
       "                [\n",
       "                    \"2011\",\n",
       "                    17.65\n",
       "                ],\n",
       "                [\n",
       "                    \"2012\",\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2013\",\n",
       "                    15.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2014\",\n",
       "                    30.43\n",
       "                ],\n",
       "                [\n",
       "                    \"2015\",\n",
       "                    56.67\n",
       "                ],\n",
       "                [\n",
       "                    \"2016\",\n",
       "                    25.53\n",
       "                ],\n",
       "                [\n",
       "                    \"2017\",\n",
       "                    16.9\n",
       "                ],\n",
       "                [\n",
       "                    \"2018Q3\",\n",
       "                    0.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4189723,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 1\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5185\\u8d44\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"2008\",\n",
       "                    44.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2009\",\n",
       "                    22.22\n",
       "                ],\n",
       "                [\n",
       "                    \"2010\",\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2011\",\n",
       "                    50.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2012\",\n",
       "                    19.7\n",
       "                ],\n",
       "                [\n",
       "                    \"2013\",\n",
       "                    55.7\n",
       "                ],\n",
       "                [\n",
       "                    \"2014\",\n",
       "                    23.58\n",
       "                ],\n",
       "                [\n",
       "                    \"2015\",\n",
       "                    25.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2016\",\n",
       "                    7.89\n",
       "                ],\n",
       "                [\n",
       "                    \"2017\",\n",
       "                    35.3\n",
       "                ],\n",
       "                [\n",
       "                    \"2018Q3\",\n",
       "                    43.84\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4189723,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 1\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5916\\u8d44\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"2008\",\n",
       "                    28.77\n",
       "                ],\n",
       "                [\n",
       "                    \"2009\",\n",
       "                    21.28\n",
       "                ],\n",
       "                [\n",
       "                    \"2010\",\n",
       "                    50.88\n",
       "                ],\n",
       "                [\n",
       "                    \"2011\",\n",
       "                    64.53\n",
       "                ],\n",
       "                [\n",
       "                    \"2012\",\n",
       "                    92.23\n",
       "                ],\n",
       "                [\n",
       "                    \"2013\",\n",
       "                    76.47\n",
       "                ],\n",
       "                [\n",
       "                    \"2014\",\n",
       "                    110.42\n",
       "                ],\n",
       "                [\n",
       "                    \"2015\",\n",
       "                    111.44\n",
       "                ],\n",
       "                [\n",
       "                    \"2016\",\n",
       "                    60.9\n",
       "                ],\n",
       "                [\n",
       "                    \"2017\",\n",
       "                    27.1\n",
       "                ],\n",
       "                [\n",
       "                    \"2018Q3\",\n",
       "                    26.92\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4189723,\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 1\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u91d1\\u878d\\u79df\\u8d41\",\n",
       "                \"\\u5185\\u8d44\\u79df\\u8d41\",\n",
       "                \"\\u5916\\u8d44\\u79df\\u8d41\",\n",
       "                \"\\u91d1\\u878d\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "                \"\\u5185\\u8d44\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\",\n",
       "                \"\\u5916\\u8d44\\u79df\\u8d41\\u540c\\u6bd4\\u589e\\u957f(%)\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"2008\",\n",
       "                \"2009\",\n",
       "                \"2010\",\n",
       "                \"2011\",\n",
       "                \"2012\",\n",
       "                \"2013\",\n",
       "                \"2014\",\n",
       "                \"2015\",\n",
       "                \"2016\",\n",
       "                \"2017\",\n",
       "                \"2018Q3\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"9%\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "myChart_8db4bcb7f55d47afa753ca25a6129a3d.setOption(option_8db4bcb7f55d47afa753ca25a6129a3d);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.custom.grid.Grid at 0x15dd7313400>"
      ]
     },
     "execution_count": 130,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import *\n",
    "grid = Grid()\n",
    "\n",
    "attr = list(df['年'])\n",
    "v0= list(df['企业数'].values)\n",
    "v1 =list(df['金融租赁'].values)\n",
    "v2 = list(df['内资租赁'].values) \n",
    "v3 =list(df['外资租赁'].values)\n",
    "\n",
    "##\n",
    "bar = Bar(\"\")\n",
    "#bar.add('全国租赁业企业数量',attr,v0,is_label_show=True,is_splitline_show=False,\n",
    "#       is_yaxis_show=False)\n",
    "bar.add(\"金融租赁\", attr, v1, is_stack=True,\n",
    "       is_splitline_show=False,is_label_show=True,)\n",
    "bar.add(\"内资租赁\", attr, v2, is_stack=True,\n",
    "       is_splitline_show=False,is_label_show=True,)\n",
    "bar.add(\"外资租赁\", attr, v3, is_stack=True,\n",
    "       is_splitline_show=False,is_label_show=True,)\n",
    "\n",
    "v4=list((df['金融租赁同比'].values).round(2))\n",
    "v5=list((df['内资租赁同比'].values).round(2))\n",
    "v6=list((df['外资租赁同比'].values).round(2))\n",
    "\n",
    "line = Line()\n",
    "line.add(\"金融租赁同比增长(%)\", attr,v4,is_splitline_show=False,\n",
    "         is_smooth=True,is_label_show=True,)\n",
    "line.add(\"内资租赁同比增长(%)\", attr,v5,is_splitline_show=False,\n",
    "         is_smooth=True,is_label_show=True,)\n",
    "line.add(\"外资租赁同比增长(%)\", attr,v6,is_splitline_show=False,\n",
    "         is_smooth=True,is_label_show=True,)\n",
    "\n",
    "overlap = Overlap(width=1200, height=600)\n",
    "overlap.add(bar)\n",
    "overlap.add(line, is_add_yaxis=True, yaxis_index=1)\n",
    "\n",
    "grid.add(overlap, grid_right=\"9%\")\n",
    "grid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 148,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"416fd98a73d549e8a2f8b42b9d6b87ed\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_416fd98a73d549e8a2f8b42b9d6b87ed = echarts.init(document.getElementById('416fd98a73d549e8a2f8b42b9d6b87ed'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_416fd98a73d549e8a2f8b42b9d6b87ed = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 8570799,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u76f4\\u63a5\\u79df\\u8d41\",\n",
       "                    \"value\": 12.5\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u552e\\u540e\\u56de\\u79df\",\n",
       "                    \"value\": 83.9\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5176\\u4ed6\\u79df\\u8d41\\u65b9\\u5f0f\",\n",
       "                    \"value\": 3.6\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"outside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                }\n",
       "            },\n",
       "            \"seriesId\": 8570799\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u76f4\\u63a5\\u79df\\u8d41\",\n",
       "                \"\\u552e\\u540e\\u56de\\u79df\",\n",
       "                \"\\u5176\\u4ed6\\u79df\\u8d41\\u65b9\\u5f0f\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_416fd98a73d549e8a2f8b42b9d6b87ed.setOption(option_416fd98a73d549e8a2f8b42b9d6b87ed);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.pie.Pie at 0x15dd7353b38>"
      ]
     },
     "execution_count": 148,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Pie\n",
    "\n",
    "attr = [\"直接租赁\", \"售后回租\", \"其他租赁方式\"]\n",
    "v1 = [12.5, 83.9, 3.6]\n",
    "pie = Pie(\"\")\n",
    "pie.add(\"\", attr, v1, is_label_show=True)\n",
    "\n",
    "pie"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-10T15:09:22.148136Z",
     "start_time": "2019-04-10T15:09:22.129155Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"fa6eb3d14f034d1290e52d06e0e45acd\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_fa6eb3d14f034d1290e52d06e0e45acd = echarts.init(document.getElementById('fa6eb3d14f034d1290e52d06e0e45acd'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_fa6eb3d14f034d1290e52d06e0e45acd = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 2011069,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u80fd\\u6e90\\u8bbe\\u5907\",\n",
       "                    \"value\": 20.2\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91c7\\u77ff\\u3001\\u51b6\\u91d1\\u4e13\\u7528\\u8bbe\\u5907\",\n",
       "                    \"value\": 16.5\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u901a\\u4fe1\\u7535\\u5b50\\u8bbe\\u5907\",\n",
       "                    \"value\": 16.3\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5efa\\u7b51\\u5de5\\u7a0b\\u8bbe\\u5907\",\n",
       "                    \"value\": 16.1\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u533b\\u7597\\u5236\\u836f\\u8bbe\\u5907\",\n",
       "                    \"value\": 11.8\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5de5\\u4e1a\\u88c5\\u5907\",\n",
       "                    \"value\": 7.8\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5176\\u4ed6\",\n",
       "                    \"value\": 11.3\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"outside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                }\n",
       "            },\n",
       "            \"seriesId\": 2011069\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u80fd\\u6e90\\u8bbe\\u5907\",\n",
       "                \"\\u91c7\\u77ff\\u3001\\u51b6\\u91d1\\u4e13\\u7528\\u8bbe\\u5907\",\n",
       "                \"\\u901a\\u4fe1\\u7535\\u5b50\\u8bbe\\u5907\",\n",
       "                \"\\u5efa\\u7b51\\u5de5\\u7a0b\\u8bbe\\u5907\",\n",
       "                \"\\u533b\\u7597\\u5236\\u836f\\u8bbe\\u5907\",\n",
       "                \"\\u5de5\\u4e1a\\u88c5\\u5907\",\n",
       "                \"\\u5176\\u4ed6\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_fa6eb3d14f034d1290e52d06e0e45acd.setOption(option_fa6eb3d14f034d1290e52d06e0e45acd);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.pie.Pie at 0x24f4ac98c88>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import *\n",
    "attr=['能源设备','采矿、冶金专用设备','通信电子设备','建筑工程设备','医疗制药设备','工业装备','其他']\n",
    "v=[20.2,16.5,16.3,16.1,11.8,7.8,11.3]\n",
    "pie = Pie('')\n",
    "pie.add('',attr,v,is_label_show = True)\n",
    "pie"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
